526745de8155241001b50b3c931ded3d4c7506c1,repository/src/main/java/de/axelfaust/alfresco/simplecontentstores/repo/store/SelectorPropertyContentStore.java,SelectorPropertyContentStore,onAddAspect,#NodeRef#QName#,215
Before Change
{
final Serializable selectorValue = properties.get(this.selectorPropertyQName);
final ContentStore oldStore = this.fallbackStore;
ContentStore newStore = this.storeBySelectorPropertyValue.get(selectorValue);
if (newStore == null)
{
newStore = this.fallbackStore;
}
if (oldStore != newStore || (oldStore == newStore && newStore != this.fallbackStore))
{
final Map<QName, Serializable> updates = new HashMap<>();
final ContentStore targetStore = newStore;
ContentStoreContext.executeInNewContext(new ContentStoreOperation<Void>()
{
/**
* {@inheritDoc}
*/
@Override
public Void execute()
{
SelectorPropertyContentStore.this.processContentPropertiesMove(nodeRef, oldStore, targetStore, updates, properties);
return null;
}
});
if (!updates.isEmpty())
{
this.nodeService.addProperties(nodeRef, updates);
}
}
}
After Change
// no need to move if no specific after value
if (selectorValue != null)
{
ContentStoreContext.executeInNewContext(new ContentStoreOperation<Void>()
{
/**
* {@inheritDoc}
*/
@Override
public Void execute()
{
SelectorPropertyContentStore.this.processContentPropertiesMove(nodeRef, properties, selectorValue);
return null;
}
});
}
}
}